Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

183
Vistas
Getting authentication error "Unable to find credentials in request" when I make a POST request in Cypress automation

I'm making a POST request in cypress automation but I keep getting an authentication error. The endpoint takes basic authetication.

  "error": "AuthenticationError",
  "text": "Unable to find credentials in request". 

Here is my request:
 
 cy.request({
                    url: 'TEST ENDPOINT',
                    method : 'POST',
                    auth: { 
                        username: 'test@test.com', 
                        password: 'test1'
                    }, 

                  body: {
                        
                        "firstname": "Bruce",
                        "lastname": "lee"
                 
                    });
 
          });

When I hit the same endpoint in POSTMAN it works as expected. Not sure what's wrong with my request.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

There is no key called "auth", you should use either Header to pass your token or auth key in it.

method: 'POST',
    url: url,
    headers: {
        'content-type': 'application/json',
        'Accept': 'application/json',
        'Authorization':'Bearer '+token
    },
    body: JSON.stringify(body)
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda